package com.xyzh.application.common.constants;

import javax.validation.Valid;
import java.util.Objects;

public class ReqPage <T>{
    private int pageCurrent;

    private int pageSize;

    @Valid
    private T data;

    /**
     *
     * @Description 是否导出,默认不导出,为ture的情况下进行导出
     * @Date 14:21 2022/8/29
     * @Param
     * @returnF
     **/
    private boolean export = false;
    public boolean export () {
        return export;
    }

    public void setExport (boolean export) {
        this.export = export;
    }

    public int getPageCurrent() {
        return pageCurrent;
    }

    public void setPageCurrent(int current) {
        this.pageCurrent = current;
    }

    public int getPageSize() {
        return pageSize;
    }

    public void setPageSize(int size) {
        this.pageSize = size;
    }

    public T getData() {
        return data;
    }

    public void setData(T data) {
        this.data = data;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (!(o instanceof ReqPage)) {
            return false;
        }
        ReqPage<?> reqPage = (ReqPage<?>) o;
        return pageCurrent == reqPage.pageCurrent &&
                pageSize == reqPage.pageSize &&
                Objects.equals(data, reqPage.data);
    }

    @Override
    public int hashCode() {
        return Objects.hash(pageCurrent, pageSize, data);
    }

    @Override
    public String toString() {
        return "ReqPage{" +
                "current=" + pageCurrent +
                ", size=" + pageSize +
                ", data=" + data +
                '}';
    }
}
